<template>
    <div>
        <el-form :inline="false" :model="formInline" class="demo-form-inline">
            <el-form-item label="姓名">
                <el-input v-model="formInline.name" placeholder="请填写姓名" clearable />
            </el-form-item>
            <el-form-item label="性别">
                <el-select v-model="formInline.sex" placeholder="请选择时间">
                    <el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value">
                    </el-option>
                </el-select>
            </el-form-item>
        </el-form>
        <div class="float-right">
            <el-button type="primary" @click="createOk">确 定</el-button>
            <el-button @click="emit('close')">取 消</el-button>
        </div>
    </div>
</template>
<script setup >
import { reactive } from 'vue'
const emit = defineEmits(['creaeteSuccess', 'close'])
const formInline = reactive({
    name: '',
    sex: ''
})
const options = [
    {
        value: '1',
        label: '男'
    },
    {
        value: '2',
        label: '女'
    }
]

function createOk() {
    emit('creaeteSuccess', formInline)
    emit('close')
}
</script>